<?php

declare(strict_types=1);

namespace App\CustHub\Controller;

use App\CustHub\Annotation\ApiAuth;
use App\CustHub\Annotation\VerifySignature;
use App\CustHub\Service\PayService;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\PostMapping;

#[Controller('ch/pay'),ApiAuth,VerifySignature]
class PayController extends BaseController
{

    #[Inject]
    protected PayService $payService;

    /**
     * 支付配置
     * @return \Psr\Http\Message\ResponseInterface
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     */
    #[PostMapping('getConfig')]
    public function getConfig(): \Psr\Http\Message\ResponseInterface
    {
        return $this->success($this->payService->getConfig($this->request->all()));
    }
}